@use "sass:color";

.release-card-container {
  display: flex;
  flex-direction: column;

  .release-item {
    position: relative;
    width: fit-content;
    height: fit-content;
    aspect-ratio: 1;
  }

  .release-information {
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
  }

  .tags {
    font-size: smaller;
  }

  .listen-count {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
  }

  .listen-count-number {
    margin-left: 5px;
  }

  .cover-art-info {
    width: 100%;
    background-color: color.scale($blue, $alpha: -10%);
    padding: 0.5rem;
    color: $white;
    text-align: center;
    display: flex;
    justify-content: space-between;
    margin-top: 1px;
  }

  .cover-art-info:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
  }

  .release-coverart-container:hover .hover-backdrop {
    background: linear-gradient(
      18deg,
      rgba(0, 0, 0, 0.8) -15.26%,
      rgba(0, 0, 0, 0.16) 119.11%
    );
    border-radius: 8px;
    opacity: 1;
  }

  .hover-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;

    svg {
      width: 6rem;
      height: 6rem;
      color: $gray-300;
      opacity: 0.6;
    }
  }

  .release-coverart-container:hover .release-coverart-placeholder svg {
    filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
  }

  .release-coverart-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(
      18deg,
      rgba(0, 0, 0, 0.2) -15.26%,
      rgba(0, 0, 0, 0.04) 119.11%
    );

    svg {
      width: 6rem;
      height: 6rem;
      color: $gray-300;
      filter: none;
      transition: filter 0.3s ease-out;
    }
  }

  .release-coverart-placeholder.hide-placeholder {
    display: none;
    height: 0;
  }

  .release-date {
    text-transform: uppercase;
    text-align: right;
    font-weight: 500;
    font-size: smaller;
    cursor: default;
  }

  .release-coverart.hide-image {
    display: none;
    height: 0;
  }

  .release-coverart {
    width: 12em;
    height: 12em;
    border-radius: 8px;
    user-select: none;
    aspect-ratio: 1;
    object-fit: cover;
    box-shadow: 4px 4px 8px -2px color.scale($asphalt, $alpha: -80%);
    transition: box-shadow 0.3s cubic-bezier(0, 0, 0.2, 1) 0.1s;

    &:hover {
      box-shadow: 8px 2px 20px -4px color.scale($asphalt, $alpha: -40%);
    }
  }

  .name-type-container {
    margin-top: 0.5rem;
    width: 12em;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
  }

  .release-name {
    flex-grow: 1;
    padding-right: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .release-type-chip {
    text-align: left;
    text-transform: uppercase;
    font-weight: 500;
    font-size: smaller;
    cursor: default;
  }

  .release-artist {
    width: 12em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    a {
      font-weight: 500;
    }
  }
}
